/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yinshi.j2d;

import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;

/**
 *
 * @author yinshi
 */
public class TransformGroup extends Group {

    private final AffineTransform transform = new AffineTransform();

    public void paint(Graphics2D g, int x, int y, int width, int height) {
        AffineTransform temp_transform = g.getTransform();
        g.transform(this.transform);
        super.paint(g, x, y, width, height);
        g.setTransform(temp_transform);
    }

    public AffineTransform getTransform() {
        return transform;
    }
}
